
var flowidea = Ext.namespace('flowidea.win');

flowidea.win = {
	ym : '',
	day : '',
	username : '',
	openCommentWindow: function(){
		var obj = this;
		var temp = {
			// ----------------------------------------------------------------------
			// 加载列表
			// ----------------------------------------------------------------------
			grid : new Ext.grid.GridPanel({
				id:"mes_grid",
				height:450,
				store : new Ext.data.Store({
					proxy :new Ext.data.HttpProxy({
						url :'planMonth!getRjgzldf.do?ym=' + obj.ym + '&day=' + obj.day + '&username=' + encodeURI(obj.username)
					}),
					reader :new Ext.data.JsonReader({
						root :'result',
						totalProperty :'totalCount',
						fields : ['id','rq', 'fzrname','cy','gs','gzrw','bz']
					}),
					autoLoad:true,
					remoteSort :false
				}),
				//frame:true,
				stripeRows:true,
				cm: new Ext.grid.ColumnModel({
		    		defaults: {
		        		sortable: true
		    		},
		    		columns: [
			           new Ext.grid.RowNumberer({
			                header:'No.',
			                width:40,
			                renderer:function(value,metadata,record,rowIndex){
		                        if (record.store.lastOptions.params != undefined) {
		                       	 	var start = record.store.lastOptions.params.start;
		                       	 	return start + rowIndex+1;
		                		} else {
		                			return rowIndex+1;
		                		}
			                }
			            }),
						{	id:'id',
							header :"序号",
							dataIndex :'id',
							sortable :true,
							hidden :true
						}, {
							header :"时间",
							width :50,
							dataIndex :'rq',
							sortable :true,
							align:'center'
						}, {
							
							header :"负责人",
							width :50,
							dataIndex :'fzrname',
							sortable :true,
							align:'center'
						}, {
							
							header :"成员",
							width :50,
							dataIndex :'cy',
							sortable :true,
							align:'center'
						}, {
							
							header :"工作内容",
							width :100,
							dataIndex :'gzrw',
							sortable :true,
							align:'center',
							renderer: function(value, meta, record) {     
                                          meta.attr = 'style="white-space:normal;"';      
                                          return value;      
                              }   
							
							
						}, {
							header :"备注",
							width :50,
							dataIndex :'bz',
							sortable :true,
							align:'center',
							renderer: function(value, meta, record) {     
                                          meta.attr = 'style="white-space:normal;"';      
                                          return value;      
                              }   
						}]
				}),
				selModel  : new Ext.grid.RowSelectionModel({singleSelect : true}),
				loadMask : {
					msg :'载入中,请稍候...'
				},
				viewConfig:{
					forceFit:true
				},
				tbar :[
					{
						id :'noteList_query',
						text :'刷新',
						cls:'x-btn-text-icon',
						icon:contextpath + '/images/shuax.gif',
			            handler:function() {
			            	temp.grid.store.reload();
						}
					}
				]
			})
		}
		
		var win = new Ext.Window({
				closeAction :'close',
				width: 800,
				height: 500,
				layout: 'border',
				resizable : false,
				modal: true,
				plain: true,
				title:'工作事项',
		        items:[{
			            region:'center',
			            width:800,
			            items:[temp.grid],
						height:240,
						//split:true,
			            //collapsible:true,
			            //collapseMode: 'mini',
			            defaults:{autoScroll:true,border:false},
			            layoutConfig:{
			                animate:true
			            }
		        	}]
	
			});

		win.show();

	}

}